<extend name="Index::index"/>
<block name="title"><title>订单管理</title></block>
<block name="table">
	<div class="agoods_nav">
		<span>订单列表</span>
	</div>
	
	<table class="table" border="1" cellspacing="0" cellpadding="5" align="center">
		<tr bgcolor="#ccc">
			<th>编号</th>
			<th>订单编号</th>
			<th>买家</th>
			<th>收货人</th>
			<th>收货地址</th>
			<th>联系电话</th>
			<th>是否付款</th>
			<th>是否收货</th>
			<th>操作</th>
		</tr>
		<foreach name="list" item="val">
			<tr>
				<td>{$val['olid']}</td>
				<td>{$val['olo']}</td>
				<td>{$val['uname']}</td>
				<td>{$val['adre']}</td>
				<td>{$val['adad']}</td>
				<td>{$val['adtel']}</td>
				<td width="80px;">
					<if condition="$val['olpay'] eq 1">
					<button style="width:60px;height:30px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">已付款</button>
					<else/>
					<button style="width:60px;height:30px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">未付款</button>
					</if>
				</td>
				<td width="80px;">
					<switch name="val.olde">
						<case value="0"><a href="{:U('Order/fa',['id'=>$val[olid],'p'=>$p])}"><button style="width:60px;height:30px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">发货</button></a></case>
						<case value="1"><button style="width:60px;height:30px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">未收货</button></case>
						<case value="2"><button style="width:60px;height:30px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">已收货</button></case>
					</switch>
				</td>
				<td width="80"><a href="{:U('Order/detail',['id'=>$val['olid']])}" style="color:#000;display:block">查看详情</a><a href="{:U('Order/del',['id'=>$val['olid']])}" style="color:#000;display:block">删除</a></td>	
				</tr>
			</foreach>
			<tr>
				<th colspan="9">
				 	{$page}
				</th>
			</tr>
		</table>
</block>